//#include"TcpServer.hpp"
#include"HttpServer.hpp"
#include<iostream>
#include<string>
#include<memory>
#include"log.hpp"



static void Usage(std::string proc) //使用手册，告诉如何传入参数
{
    std::cout << "Usage:\n\t" << proc << " port" << std::endl;
} 


int main(int argc, char *argv[])
{
    //LOG(INFO, "debug project!!");
    if(argc != 2)
    {
        //说明输入的参数个数错误
        Usage(argv[0]);
        exit(4);
    }

    int port = atoi(argv[1]);   //传入端口

    // TcpServer* svr = TcpServer::getinstance(port);
    // for(;;)
    // {       
    // }

    std::shared_ptr<HttpServer> http_server(new HttpServer(port));//这段初始化对象怎么理解？ --搞一个临时对象用于初始化

    http_server->InitServer();
    http_server->Loop();

    return 0;
}